|
|
|
|
|
|
|
Figure 15.8.
The MonthView control displayed at
runtime can be accessed with the mouse
or the keyboard. |
|
|
|
|
|
|
|
|
Buttons at the top of the control are used to scroll the months in and out of view. The user can navigate using either the keyboard or the mouse. You can also see that the specified date is highlighted while the current date is circled. To see how this control works, start a new project in Visual Basic and add the MonthView control to the Toolbox. Now, add the MonthView control and two command buttons to the form as shown in Figure 15.9. |
|
|
|
|
|
|
|
|
Figure 15.9.
Adding the MonthView control to a form. |
|
|
|
|
|
|
|
|
Set the Name properties for the controls as shown in Table 15.10. |
|
|
|
|
| TABLE 15.10. SETTING THE PROPERTIES FOR THE MONTHVIEW DEMO. | | Control | Property | Value | | MonthView | Name | mvDate | | Command1 | Name | cmdShowDate | | Caption | Show Date | | Command2 | Name | cmdQuit | | Caption | Quit |
|
|
|
|
|
|
In the mvDate_DateClick routine, add the following line of code: |
|
|
|
|
|
|
|
|
MsgBox You have selected the date: & DateClicked, vbInformation |
|
|
|
|
|
|
|
|
When you run this application, the above code will display a message dialog telling you the date that you clicked the MonthView control. The controls Value property will be set |
|
|
|
|
|